/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package azhar.persistance;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Al-Insan
 */
@Entity
@Table(name = "kelas")
@NamedQueries({
    @NamedQuery(name = "Kelas.findAll", query = "SELECT k FROM Kelas k"),
    @NamedQuery(name = "Kelas.findByCodeKelas", query = "SELECT k FROM Kelas k WHERE k.codeKelas = :codeKelas"),
    @NamedQuery(name = "Kelas.findByNamaKelas", query = "SELECT k FROM Kelas k WHERE k.namaKelas = :namaKelas"),
    @NamedQuery(name = "Kelas.findByCodeJejang", query = "SELECT k FROM Kelas k WHERE k.codeJejang = :codeJejang")})
public class Kelas implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "code_kelas")
    private Integer codeKelas;
    @Basic(optional = false)
    @Column(name = "nama_kelas")
    private String namaKelas;
    @Basic(optional = false)
    @Column(name = "code_jejang")
    private int codeJejang;

    public Kelas() {
    }

    public Kelas(Integer codeKelas) {
        this.codeKelas = codeKelas;
    }

    public Kelas(Integer codeKelas, String namaKelas, int codeJejang) {
        this.codeKelas = codeKelas;
        this.namaKelas = namaKelas;
        this.codeJejang = codeJejang;
    }

    public Integer getCodeKelas() {
        return codeKelas;
    }

    public void setCodeKelas(Integer codeKelas) {
        this.codeKelas = codeKelas;
    }

    public String getNamaKelas() {
        return namaKelas;
    }

    public void setNamaKelas(String namaKelas) {
        this.namaKelas = namaKelas;
    }

    public int getCodeJejang() {
        return codeJejang;
    }

    public void setCodeJejang(int codeJejang) {
        this.codeJejang = codeJejang;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codeKelas != null ? codeKelas.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Kelas)) {
            return false;
        }
        Kelas other = (Kelas) object;
        if ((this.codeKelas == null && other.codeKelas != null) || (this.codeKelas != null && !this.codeKelas.equals(other.codeKelas))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "azhar.persistance.Kelas[codeKelas=" + codeKelas + "]";
    }

}
